package com.crm.system.controller.contractManager;

import com.crm.common.model.DataResponse;
import com.crm.common.model.DhResponse;
import com.crm.common.model.Enum.ResponseCodeEnum;
import com.crm.model.vo.cluePoolManager.NoContactCustomerDetailVO;
import com.crm.model.vo.cluePoolManager.NoContactCustomerVO;
import com.crm.common.helper.PageHelper;
import com.crm.system.service.contractManager.ForgetRemindService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @description: 遗忘提醒
 * @author: lixq-f
 * @create: 2021/03/25
 */
@RestController
@RequestMapping("/forgetRemind")
@Slf4j
public class ForgetRemindController {


    @Autowired
    private ForgetRemindService remindService;

    /**
     * 遗忘提醒信息
     *
     * @return
     */
    @GetMapping("/forgetRemindStatistics")
    public DataResponse forgetRemindStatistics() {
        NoContactCustomerVO noContactCustomerVO = remindService.selectForgetRemindMsg();
        return new DhResponse(ResponseCodeEnum.OK.getResponseCode(), noContactCustomerVO);
    }


    /**
     * 遗忘客户明细
     * @param pageIndex
     * @param pageSize
     * @param dataType 为超过7天、15天、30天、3个月、6个月、逾期
     * @return
     */
    @GetMapping("/forgetRemindDetails")
    public PageHelper selectForgetRemindDetails(@RequestParam(value = "pageIndex", defaultValue = "1", required = false) Integer pageIndex,
                                               @RequestParam(value = "pageSize", defaultValue = "20", required = false) Integer pageSize,
                                               @RequestParam(value = "dataType") String dataType,
                                               @RequestParam(value = "isMember") Integer isMember) {
        PageHelper<NoContactCustomerDetailVO> page =
                remindService.selectForgetRemindDetailsByPage(pageIndex,pageSize,Integer.valueOf(dataType), isMember);
        return page;
    }








}
